<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@page import="com.news.bean.NewsType;"%>
<%
            String path = request.getContextPath();
            String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
    <head>
        <base href="<%=basePath%>">

        <title>My JSP 'MyJsp1011.jsp' starting page</title>

        <meta http-equiv="pragma" content="no-cache">
        <meta http-equiv="cache-control" content="no-cache">
        <meta http-equiv="expires" content="0">
        <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
        <meta http-equiv="description" content="This is my page">
        <!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
        <%
        String err=request.getParameter("err");
        if(err!=null&&!err.isEmpty()){
            if(err.equalsIgnoreCase("foreignErr")){ %>
            <script type="text/javascript">
                alert('不能删除！\n存在该类型的新闻。');
            </script>
          <%    }
            }
        %>
        <script type="text/javascript">

        </script>
    </head>

    <body>
    <LINK href="images/admin_css.css" type=text/css rel=stylesheet>
          <table width="98%"  border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#F2F9FD">
        <tr bgcolor="#f0f0f0">
            <td width="700" height="25" bgcolor="#D2E8F6">&nbsp;&nbsp;管理网站分类信息</td>
        </tr>
        <tr align="center" bgcolor="#FFFFFF">
            <td height="35" align="left">
                <table width="785" height="87" border="0" cellpadding="0" cellspacing="1" bgcolor="#FFFFFF">
                    <tr>
                        <td height="25" valign="top">
                            <table width=95% border="0" align="center" cellpadding="0" cellspacing="0">
                                <tr><td width="48%">分类栏目</td><td width="26%">修改</td><td width="26%">删除</td></tr>
                                <%
                    List<NewsType> list = (List) request.getAttribute("list");
                    if (list != null && list.size() > 0) {
                        for (NewsType nt : list) {
                                %>

                                <tr>
                                    <td width=48% height="22" align=left valign="bottom"  >&nbsp;&nbsp;<font color="gray">┣</font>&nbsp;<a href="newstype?cmd=loadedit&id=<%=nt.getId()%>&name=<%=nt.getName()%>&sort=<%=nt.getSort()%>"><%=nt.getName()%></a></td>
                                    <td width="26%"><input type="button" value="修改" onclick="window.location='newstype?cmd=loadedit&id=<%=nt.getId()%>&name=<%=nt.getName()%>&sort=<%=nt.getSort()%>'"></td>
                                    <td><input type="button" value="删除" onclick="window.location='newstype?cmd=delete&id=<%=nt.getId()%>'"></td>
                                </tr>
                                <%}
            }%>




                                <tr>
                                    <td colspan=5 height=1 background="images/bj_x1.gif" ></td>
                                </tr>
                            </table>

                        </td>
                    </tr>
                </table></td>
        </tr>
    </table>
    <td></td>
</tr>
</table>
</body>
</html>
